﻿@{
    Layout = null;
    EBook Ebook = ViewBag.Ebook as EBook;
}
<!DOCTYPE html>
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head>
    <title>在线阅读</title>
    <script src="~/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="~/Scripts/pdfobject.js"></script>
    <style type="text/css">
       
        #pdf {
            width: 800px;
            height: 800px;
            margin: 2em auto;
            border: 1px solid #65452;
        }

            #pdf p {
                padding: 1em;
            }

            #pdf object {
                display: block;
                border: solid 1px #123;
            }

    </style>
 <!-- <script type="text/javascript">
    $(function () {
        var w = $(document).width();
        var h = $(document).height();
        $("#pdf1").css("width", w).css("height", h);


        // 下面代码都是处理IE浏览器的情况
        if (window.ActiveXObject || "ActiveXObject" in window) {
            //判断是否为IE浏览器，"ActiveXObject" in window判断是否为IE11
            //判断是否安装了adobe Reader
            for (x = 2; x < 10; x++) {
                try {
                    oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
                    if (oAcro) {
                        flag = true;
                    }
                } catch (e) {
                    flag = false;
                }
            }
            try {
                oAcro4 = new ActiveXObject('PDF.PdfCtrl.1');
                if (oAcro4) {
                    flag = true;

                }
            } catch (e) {
                flag = false;
            }
            try {
                oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
                if (oAcro7) {
                    flag = true;
                }
            } catch (e) {
                flag = false;
            }
            if (flag) {
                $('#pdf').hide();
                
            }
            else {
                alert("对不起,您还没有安装PDF阅读器软件呢,为了方便预览PDF文档,请选择安装！");
                location = "http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.3/chs/AdbeRdr930_zh_CN.exe";
            }
        }
        else {
            //alert($.trim(urls));
            var success = new PDFObject({ url: 'PDF/19-P1012728-064_ZHCN-Draft.pdf', pdfOpenParams: { scrollbars: '0', toolbar: '0', statusbar: '0' } }).embed("pdf1");
            if (!success) {
                var opts = {
                    width: $(document).width(),
                    height: $(document).height(),
                    autoplay: true
                };
            }
        }
    });
    </script>-->
    <script type="text/javascript">
    window.onload = function () {
        var success = new PDFObject({ url: @ViewBag.FileLoad, pdfOpenParams: { scrollbars: '0', toolbar: '0', statusbar: '0' } }).embed("pdf");
    };
    </script>
</head>

<body>
    <div id="pdf">
       
    </div>
</body>
</html>